<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@page import="java.io.InputStream"%>
<%@page import="org.apache.ibatis.io.Resources"%>
<%@page import="org.apache.ibatis.session.SqlSessionFactory"%>
<%@page import="org.apache.ibatis.session.SqlSession"%>
<%@page import="java.io.IOException"%>
<%@page import="org.apache.ibatis.session.SqlSessionFactoryBuilder"%>
<%@page import="util.Info"%>
<%@page import="dao.CommDAO"%>
<%@page import="util.PageManager"%>
 
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="桌面壁纸网站 - Clean HTML5 and CSS3 responsive template">
<meta name="author" content="MyPassion">

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<title>桌面壁纸网站 - Responsive HTML5 and CSS3 </title>

<link rel="shortcut icon" href="img/sms-4.ico" />

<!-- STYLES -->
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/superfish.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/fontello/fontello.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/flexslider.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/ui.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/base.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/style.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/960.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/devices/1000.css" media="only screen and (min-width: 768px) and (max-width: 1000px)" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/devices/767.css" media="only screen and (min-width: 480px) and (max-width: 767px)" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/devices/479.css" media="only screen and (min-width: 200px) and (max-width: 479px)" />
 
<!--[if lt IE 9]> <script type="text/javascript" src="/wallpaper/frontfiles/js/customM.js"></script> <![endif]-->


</head>

<body>

<!-- Body Wrapper -->
<div class="body-wrapper">
	<div class="controller">
    <div class="controller2">

        <jsp:include page="top.jsp"></jsp:include>
        
        <!-- Content -->
        <section id="content">
            <div class="container">
           
       
            
            	<!-- Main Content -->
                <div class="main-content">
                    
                    <!-- Single -->
                    <div class="column-two-third single">
                    	 
                        <div class="relatednews">
                            <h5 class="line"><span>留言板.</span></h5>
                            	<TABLE cellSpacing=2 cellPadding=3 width="100%" align=center  bgColor=#ffffff border=0> 
     
                    
                    
    <%
      if(Info.getUser(request)!=null){
    HashMap extmap = new HashMap();
    extmap.put("uname",Info.getUser(request).get("uname"));
    extmap.put("filename",Info.getUser(request).get("filename"));
    new CommDAO().insert(request,response,"messages",extmap,true,false);
    if(request.getParameter("f")!=null)
    {
    %>
    <script language=javascript>
    alert("留言成功");
    window.location.replace("guestbook.jsp");
    </script>
    <%
    }}
    
    String url = "guestbook.jsp?1=1"; 
	ArrayList<HashMap> list = PageManager.getPages(url,5, "select * from messages order by id desc", request ); 
	for(HashMap map:list){ 
     %>
        <tr>
          <td width="10%" height="32" align="center" style="padding: 10px;border: 0px" valign="middle" class="dd">
          <img src="/wallpaper/upfile/<%=map.get("filename")%>"   height=72 width="85" />
          </td>
         
          <td width="90%" align="left" style="padding: 10px;border: 0px" valign="middle" class="dd"><font color=red><%=map.get("uname") %> &nbsp;&nbsp;
           (<%=map.get("savetime") %>) : </font>
            <table>
              <tr>
                <td height="1"></td>
              </tr>
            </table>
            <%=map.get("cont") %>
            <table>
              <tr>
                <td height="1"></td>
              </tr>
            </table>
            
            <font color=gray> 
            管理员回复 ： <%=map.get("recont").equals("")?"暂无回复":map.get("recont") %> 
            </font>
            
            </td>
        </tr>
 <%} %>
 
 
   <tr  >
    <td height="20" align="center" colspan="4" style="padding: 10px;border: 0px" id="page">
		
		 ${page.info }		 	</td>
  </tr>
  
  
  
   <%
          if(Info.getUser(request)!=null){
           %>
          <tr>
          <td height="45" align="center" colspan="5" valign="middle" style="padding: 10px" >
          <form action="guestbook.jsp?f=f" name="f1" method="post">
          <textArea cols="55" rows="3" name="cont" ></textArea>
          
          <table><tr><td height="3"></td></tr></table>
          
          <input type="submit" value=" 提交留言 " />
          </form>          </td>
          </tr> 
          <%} %>
      </table>
                            	
                        </div>
                         
                        
                    </div>
                    <!-- /Single -->
                    
                </div>
                <!-- /Main Content -->
                  
            </div>    
        </section>
        <!-- / Content -->
        
        <center>
        &nbsp;
        <div >
       
        </div>
        &nbsp;
        </center>
        <jsp:include page="foot.jsp"></jsp:include>
        
        
         
    
    </div>
	</div>
</div>
<!-- / Body Wrapper -->


<!-- SCRIPTS -->
<script type="text/javascript" src="/wallpaper/frontfiles/js/jquery.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/easing.min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/1.8.2.min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/ui.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/carouFredSel.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/superfish.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/customM.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/flexslider-min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/tweetable.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/timeago.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/jflickrfeed.min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/mobilemenu.js"></script>

<!--[if lt IE 9]> <script type="text/javascript" src="/wallpaper/frontfiles/js/html5.js"></script> <![endif]-->
<script type="text/javascript" src="/wallpaper/frontfiles/js/mypassion.js"></script>


</body>
</html>

 
            